package basisRouter

import (
	"github.com/Sir-yuChen/funAnalyse/api"
	"github.com/Sir-yuChen/funAnalyse/global"
	"github.com/Sir-yuChen/funAnalyse/middleware"
	"github.com/gin-gonic/gin"
)

type StockMenuRouter struct{}

func (co *StockMenuRouter) StockMenuApiRouter(Router *gin.RouterGroup) {
	commonJwtRouter := Router.Group(global.ROUTER_GROUP_MENU).Use(middleware.JWTAuth()).Use(middleware.CasbinMiddleware())
	api := api.ApiGroupApp.BasisApiGroup.StockMenuController
	{
		commonJwtRouter.GET(global.API_Menu_GET.BasePath, middleware.CheckApiResourcesMiddleware(global.API_Menu_GET), api.GetStockMenu)
		commonJwtRouter.POST(global.API_Menu_INSERT.BasePath, middleware.CheckApiResourcesMiddleware(global.API_Menu_INSERT), api.InsertStockMenu)
		commonJwtRouter.POST(global.API_Menu_UPDATE.BasePath, middleware.CheckApiResourcesMiddleware(global.API_Menu_UPDATE), api.UpdateStockMenu)
		commonJwtRouter.GET(global.API_Menu_DEL.BasePath, middleware.CheckApiResourcesMiddleware(global.API_Menu_DEL), api.DelStockMenu)
		commonJwtRouter.GET(global.API_Menu_Tree.BasePath, middleware.CheckApiResourcesMiddleware(global.API_Menu_Tree), api.GetStockMenuTree)
	}
}
